#ifndef __BSP_SPI_ATT7022EU_H
#define __BSP_SPI_ATT7022EU_H

#ifndef N
	#define N 5.73
#endif
extern struct spi_dev_device att7022eu_dev[6];
extern struct spi_bus_device spi_bus[3];
void bsp_spi_att7022eu_init(void);

void att70xx_CD_ReadEnable(struct spi_dev_device *dev);
void att70xx_CD_ReadDisable(struct spi_dev_device *dev);
void att70xx_CD_WriteEnable(struct spi_dev_device *dev);
void att70xx_CD_WriteDisable(struct spi_dev_device *dev);


uint32_t att70xx_r_DeviceId(struct spi_dev_device *dev);
uint32_t att70xx_r_IaRms(struct spi_dev_device *dev);
uint32_t att70xx_r_IbRms(struct spi_dev_device *dev);
uint32_t att70xx_r_IcRms(struct spi_dev_device *dev);

void att70xx_ModeCFgWrite(struct spi_dev_device *dev,uint16_t data);
uint16_t att70xx_ModeCFgRead(struct spi_dev_device *dev);
void att70xx_IaRmsoffseWrite(struct spi_dev_device *dev,uint16_t data);
uint16_t att70xx_IaRmsoffseRead(struct spi_dev_device *dev);
void att70xx_IbRmsoffseWrite(struct spi_dev_device *dev,uint16_t data);
uint16_t att70xx_IbRmsoffseRead(struct spi_dev_device *dev);
void att70xx_IcRmsoffseWrite(struct spi_dev_device *dev,uint16_t data);
uint16_t att70xx_IcRmsoffseRead(struct spi_dev_device *dev);
	

uint16_t att70xx_Reserved(struct spi_dev_device *dev);
#endif
